﻿@using Resources
@model IEnumerable<web.Models.Event>
<div class="item_list right">
    <h2>@TextStrings.ScheduledEvents</h2>
    <div class="inner">
        <ul>
            @if (Model != null)
            {
                foreach (var item in Model)
                {
                <li>
                    <a href="#"> 
                        <span style="font-size:1.2em;">@TextStrings.Description: @item.Commerce.Name</span>
                        <span>@TextStrings.Description: @item.Commerce.Description</span>
                        <span>@TextStrings.Date: @item.EventDate.ToShortDateString()</span>
                        <span>@TextStrings.Hour: @item.EventDate.ToString("hh:mm")</span>
                    </a>                            
                </li>     
                }
            }
        </ul>
    </div>
</div>
<div class="map itinerary_map"></div>

<script type="text/javascript">
    function loadEventLocations() {
        $.ajax({
            url: './Home/GetEventLocations',
            success: function (locations) {
                citytour.map.setLocations(locations, true);
            }
        });
    }
    
    $(document).ready(function () {        
        $(window).bind('itinerary', function(){
            loadEventLocations();
        });
    });
</script>